<?php
/**
  * @version $Id: comments.php,v 1.6 2007/12/25 11:55:55 visualweb Exp $ 
  * @package com_mojo
  * @copyright (c) 1guywebdesign.com 
  * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
  *
  * remm'd out the favatar hook, too many folks had issues with default install
  * removed the custom css from comments-tbd kdm
  * removed the hook for feedburner, will create short tute instead, see favatar.
  *
  * added hook to multi-author comments for linking to profiles.
  * removed p text below no comments, make way for lang files next ver.
  */
defined( '_JEXEC' ) or die('Restricted Access');//1.5
//defined( '_VALID_MOS' ) or die( 'Restricted access' );
var_dump('global cleanup needed comments.php');
	global $my, $Itemid, $mosConfig_live_site;

// create var for alternating comments and author replies
		$oddcomment	= 'altreply';
		$authcomment	= 'auth';
		
// COMMENTS--PASSWORD PROTECTED 
        if (!empty($post->post_password)) { // if there's a password
            if ($_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) {  // and it doesn't match the cookie
?>
				
	<p>
		This post is password protected. Enter the password to view comments.
	<p>
				
<?php
	return;
		}
	}
?>


<div id="mojo_comments"><!-- we got comments -->
	<?php if ($comments) : 

// COMMENTS--WE GOT COMMENTS 
	?>
	<h3><?php comments_number('No Responses', 'One Response', '% Responses' );?>
		<span> to &#8220;<?php the_title(); ?>&#8221;<span> 
	</h3> 

	<ul class="commentlist">

	<?php 
		foreach ($comments as $comment) : 
		?>

		<li class="<?php echo $oddcomment; ?>" id="comment-<?php comment_ID() ?>">
			<cite><?php comment_author_link() ?></cite> responded:
			<?php if ($comment->comment_approved == '0') : ?>
			<em>Your response is awaiting approval.</em>
			<?php endif; ?>
			<br />
			<span class="commentmetadata">
			<a href="<?php echo sefRelToAbs( 'index.php?option=com_mojo&amp;Itemid='.$Itemid.'&amp;p='.$post->ID ); ?>#comment-<?php echo $comment->comment_ID; ?>"></a>
			<?php edit_comment_link('Edit','',''); ?>
			</span>
			<span class="comment">
			<?php comment_text() ?>
			</span>
		</li>

	<?php // Changes every other comment to a different class 	TODO--need to add 'sniff' for unique author reply kdm
		if ('altreply' == $oddcomment) $oddcomment = 'reply';
		else $oddcomment = 'altreply';
		?>
	<?php endforeach; // end of comments
	 ?>
	</ul>


<?php else : ?>

<?php if ('open' == $post->comment_status) : 
// COMMENTS--NO COMMENTS YET  
?> 

	<h3>No Comments</h3>

<?php else : // comments are closed 
	?>
	<h3>Comments are closed.</h3>
		
<?php endif; ?>
<?php endif; ?>
<?php if ('open' == $post->comment_status) : 
// COMMENTS--COMMENT FORM
	?>
<div id="mojo_commentForm">
	<h3 id="respond">Add your own comment...</h3>
		<?php if ( get_option('comment_registration') && !$my->id ) : ?>
		<p>You must be registered to leave a comment.</p>
<?php else : 
	?>

<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">

<?php if ( $my->id ) : ?>

<p>Logged in as <?php echo $my->username; ?></p>

<?php else : ?>

<p>
<input class="comment" type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="22" tabindex="1" />
<label for="author"><span>your name <?php if ($req) echo "(required)"; ?></span></label>
</p>

<p>
<input class="comment" type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" />
<label for="email"><span>eMail (will not be published) <?php if ($req) echo "(required)"; ?></span></label>
</p>

<p>
<input class="comment" type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" />
<label for="url"><span>site (url)</span></label>
</p>

<?php endif; ?>

<p>
<textarea class="comment" name="comment" id="comment" cols="65" rows="10" tabindex="4"></textarea>
</p>

<p>
<input class="button" name="submit" type="submit" id="submit" tabindex="5" value="Submit Comment" />
<input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
</p>
<?php do_action('comment_form', $post->ID); ?>

</form>
</div><!--/end commentform-->

</div><!--/end mojo_comments-->

<?php endif; // If registration required and not logged in ?>
<?php endif; // if you delete this, the sky will fall on your head ?>
